<template>
  <div class="container-fluid">
    <cate-search-bar></cate-search-bar>
    <div class="row">
      <div class="col-md-12">
        <div class="row">
          <div class="col-md-2">
            <cate-menu :activeCateId="cateId"></cate-menu>
          </div>
          <div class="col-md-10">
            <products :cateId="cateId"></products>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>
<script>
// @ is an alias to /src
import CateMenu from "../components/CateMenu.vue";
import Products from "../components/Products.vue";
import CateSearchBar from "../components/CateSearchBar.vue";
export default {
  name: "Home",
  components: {
    CateSearchBar,
    CateMenu,
    Products,
  },
  data() {
    return {
      products:{}
    }
  },
  methods: {
  
  },
   beforeRouteUpdate(to) {
    this.cateId=to.params.id;
   },
   created() {
     this.cateId=this.$route.params.id;
   }

}
</script>
